Skip to content

test(e2e): gated end-to-end harness against a real org (#36)#47

Merged
lex00 merged 1 commit into
mainfrom
feat/e2e-harness
Jun 19, 2026
Merged

test(e2e): gated end-to-end harness against a real org (#36)#47
lex00 merged 1 commit into
mainfrom
feat/e2e-harness

Conversation

@lex00

@lex00 lex00 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Closes #36.

Adds a gated end-to-end suite that exercises every cycle against a real GitHub org via a real App installation — the only thing that validates the live API contract (mocks can't, especially the App-only token cycles #15/#16).

What

  • e2e/warden.e2e.test.ts + vitest.e2e.config.ts + npm run test:e2e
  • .github/workflows/e2e.ymlnightly + workflow_dispatch only (never on PRs), using WARDEN_E2E_* repo secrets
  • Excluded from npm test (default config globs src/**); tsconfig now type-checks e2e/

How it runs

Self-skips unless these are set, so default CI / contributors without a test org are unaffected:
WARDEN_E2E_APP_ID, WARDEN_E2E_INSTALLATION_ID, WARDEN_E2E_PRIVATE_KEY, WARDEN_E2E_ORG (+ optional WARDEN_E2E_APPLY=1).

  • Phase 1 (always): discovers a few repos, then for each registered cycle runs fetchLive + buildDesired + diff against the org and asserts (a) every HTTP call was a GET — fetchLive never mutates — and (b) the pipeline composes into a valid change set. This is what catches API-contract drift.
  • Phase 2 (opt-in): one teardown-guarded mutation (create + delete a repo Actions variable) proving the write path, with finally cleanup.

To activate (your side)

Add repo secrets WARDEN_E2E_APP_ID / _INSTALLATION_ID / _PRIVATE_KEY / _ORG (an App installed on a throwaway test org). Then it runs nightly, or gh workflow run e2e.yml (toggle apply for Phase 2).

Verification

  • npx tsc --noEmit clean (incl. e2e)
  • npm test still 468 (e2e excluded)
  • npm run test:e2e with no creds → 14 skipped, exit 0
  • e2e.yml valid YAML; no action-bundle drift

🤖 Generated with Claude Code

Adds e2e/warden.e2e.test.ts + vitest.e2e.config.ts + npm run test:e2e +
a nightly/dispatch e2e.yml workflow. Self-skips unless WARDEN_E2E_* env
is set, so default CI/contributors are unaffected (npm test still 468,
excludes e2e). Phase 1: per-cycle fetchLive+diff against the real org,
asserting read-only (all GET) + valid change set — validates the live API
contract mocks can't (esp. token cycles). Phase 2 (WARDEN_E2E_APPLY=1):
one teardown-guarded variable round-trip. tsconfig now type-checks e2e/.

Closes #36.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@lex00 lex00 merged commit 59d2ccf into main Jun 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: gated end-to-end harness against a real test org

1 participant